package androidServlets;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.*;

import businessServlets.ShowImage;

import sessionMenegment.SessionMgr;
import validate.Validate;

import controller.Controller;
import dataBase.Business;
import dataBase.Order;

@SuppressWarnings("serial")
public class ShowImageAndroid extends HttpServlet {
	public void doGet(HttpServletRequest req, HttpServletResponse resp)
	throws IOException {
		
		System.out.println("show image android");
		
		
		String bizKey = req.getParameter("bizKey"); 
			
		if (bizKey!=null)
		{
			long bizKeyLong = Long.parseLong(bizKey);
			Business b = Controller.getInstance().keyToBusiness(bizKeyLong);
			
			if (b!=null)
			{
				if (b.getLogoPic()!=null)
					businessServlets.ShowImage.printImage(b.getLogoPic().getBytes(),req.getParameter("width"),req.getParameter("height"),resp.getOutputStream());
			}
		}

	}

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
	throws ServletException, IOException {

	}

}
